package cc.telecomdigital.tdstock;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Handler;
import cc.telecomdigital.tdstock.Framework.UniqueItem.TDStockLog;

public class ItemCodeChangeListenerReceiver extends BroadcastReceiver
{
	private final static String	TAG	= ItemCodeChangeListenerReceiver.class
										.getSimpleName();
	private Handler			_handler;

	public ItemCodeChangeListenerReceiver(Handler handler)
	{
		_handler = handler;
	}

	@Override
	public void onReceive(Context context, Intent intent)
	{
		TDStockLog
				.d(TAG,
						" received intent item code changed,  starting to handle it");

		new Thread()
		{

			@Override
			public void run()
			{
				if (_handler != null)
				{
					_handler.sendEmptyMessage(0); //forward to the message handler looper
				}

			}
		}.start();
	}

}
